#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
int main()
{
	int t;
	cin>>t;
	while(t--)
	{
		int n;
		cin>>n;
		if(n==1)
		{
			cout<<1<<endl;
			continue;
		}
		if((n+1)*n/2 % n==0)
		{
			cout<<-1<<endl;
			continue;
		}
		for(int i=1;i<=n;i++)
		{
			if(i%2)
			{
				cout<<i+1<<' ';
			}
			else cout<<i-1<<' ';
		}
		cout<<endl;
	}

	return 0;
}

